<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>登录</title>
    <script src="__INDEX__/js/mui.min.js"></script>
    <link href="__INDEX__/css/mui.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
    <link rel="stylesheet" href="__INDEX__/css/style.css" />
    <link rel="stylesheet" href="__INDEX__/css/yund.css" />
</head>

<body>
	<header class="mui-bar mui-bar-nav">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	    <h1 class="mui-title">登录</h1>
	</header>
	<div class="mui-content login_con">
		<div class="login_top"><img src="__INDEX__/logo.png" style="width: 120px;"></div>
		<form id='my_form' class="login_formbox">
			<div class="mui-input-row">
			<label><span class="iconfont icon-msnui-caller"></span></label>
				<input id='phone' type="text" name='mobile' class="mui-input-clear mui-input" placeholder="请输入账号">
			</div>
			<div class="mui-input-row">
				<label><span class="iconfont icon-xiugaimima"></span></label>
				<input id='pwd' type="password" name='password' class="mui-input-clear mui-input" placeholder="请输入密码">
			</div>
		</form>
		<div class="link_area">
			<a class="flogin" href="{:url('index/regist')}">注册</a>
			<a href="{:url('index/forget')}">忘记密码</a>
		</div>
		<div class="mui-content-padded">
			<button id='btn' type="button" class="mui-btn mui-btn-block login_btn">登 录</button>
		</div>
	</div>
</body>
</html>
{include file="public/footer" /}
<script>
	//提交数据
	$('#btn').click(function(){
		
		var phone = $("#phone").val();
		var pwd = $("#pwd").val();
		
		if(phone == "" || phone == null){
			layer.msg("请输入登录手机号码");
			$("#phone").focus();
			return false
		}
		
		if(pwd == "" || pwd == null){
			layer.msg("请输入登录密码");
			$("#pwd").focus();
			return false
		}
		$.ajax({
             	type:"post",
                url:"{:url('index/index/login')}",
                data: $('#my_form').serialize(),//表单数据
                success:function(data){
                    if(data.code==200){
                    	layer.msg(data.msg, {
						  icon: 1,
						  time: 1000 //2秒关闭（如果不配置，默认是3秒）
						}, function(){
							location.reload();	
						});
                    }else{
                    	layer.msg(data.msg);//保存成功提示
                    }
                }
        });
	})
	
</script>
